DATA SEGMENT
    MAX_LEN DB 10
    REAL_LEN DB ?
    BUF_STR DB 10 DUP(?)
    CRIF DB 0AH,0DH,'$'
DATA ENDS
CODE SEGMENT
    ASSUME CS:CODE,DS:DATA
START:
    MOV AX,DATA
    MOV DS,AX
    XOR AX,AX
    LEA DX,MAX_LEN
    MOV AH,0AH
    INT 21H
    LEA BX,BUF_STR
    ADD BL,REAL_LEN
    ADC BH,0
    MOV BYTE PTR [BX],20H
    LEA DX,CRIF
    MOV AH,09H
    INT 21H
    LEA DX,BUF_STR
    MOV AH,09H
    INT 21H
    MOV AX,4CH
    INT 21H
CODE ENDS
END START